<?php

namespace support;

use GuzzleHttp\Client;

class BankCard
{
    protected $appCode;

    public function __construct($appCode)
    {
        $this->appCode = $appCode;
    }

    public function auth($cardNo, $name, $idCard)
    {
        return [
            'code' => 0,
            'data' => [
                'cardType' => '储蓄卡',
                'bankLogo' => '',
            ]
        ];

        $params = http_build_query([
            'cardno' => $cardNo,
            'name' => $name,
            'idcard' => $idCard
        ]);
        $client = new Client(['base_uri' => 'https://bk3.market.alicloudapi.com']);
        $response = $client->request('GET', '/lundear/verifyBankThree?' . $params, [
            'headers' => [
                'Authorization' => 'APPCODE ' . $this->appCode
            ]
        ]);

        return json_decode($response->getBody()->getContents(), true);
    }

}